package user;

import IssueFuction.AlterFunctions;
import IssueFuction.IFunctions;
import IssueFuction.PutFunctions;
import IssueFuction.ShowIFunctions;
import studentfunction.*;

import java.util.Scanner;

public class StudentUser extends User{

    public StudentUser(String name) {//构造方法中初始化接口数组
        super(name);
        super.iFunctions=new IFunction[]{//顺序对应的是菜单显示的顺序
                new ExitFunction()//退出系统
        };
        super.iFunctionss=new IFunctions[]{
                new PutFunctions(),//提出问题
                new AlterFunctions(),//修改问题
                new ShowIFunctions()//显示所有问题
        };
    }
    @Override
     public int menu() {
        System.out.println("****************************");
        System.out.println("你好 "+name+"同学"+" 欢迎来到在线答疑系统");
        System.out.println("6.提出问题！");
        System.out.println("7.修改问题！");
        System.out.println("8.显示问题！");
        System.out.println("0.退出系统！");
        System.out.println("****************************");
        System.out.println("请输入你的操作：");
        Scanner scanner = new Scanner(System.in);
        int choice = scanner.nextInt();
        return choice;
    }


}
